<?php

class DB_IP extends ORM_Table {
    static protected $table_name = 'ip';
    
    static public function getTableName($params = null) {
        //$table_name = self::$table_name.substr($params['article_type_id'], 0, 1);
        return self::$table_name;
    }
    
    static function getIp($uhash=null, $start, $end){
        if(empty($uhash)) {
            $where  = "created >=$start and created<$end) ";
        }else{
            $where  = "(`uhash` = '$uhash' and created >=$start and created<$end) ";
        }
        
        $total  = DAO_Finder::findCount(DB_IP, $where);
        if(empty($total)) {
            $total  = 0;
        }
        return $total;
    }
}

